package fxmedia.ui;

// Import JavaFX Classes
import javafx.scene.control.Label;

// Import Application Classes
import fxmedia.Constants;

/**
 * @author dca
 */
public class TrackLabel extends Label {
	/** Constructor */
	public TrackLabel(boolean bold, boolean italic, boolean underline) {
		super();
		init(bold, italic, underline);
	} // END constructor

	/** Constructor */
	public TrackLabel(String text, boolean bold, boolean italic, boolean underline) {
		super(text);
		init(bold, italic, underline);
	} // END constructor

	/**
	 * Initializes the label.<br/>
	 * @param bold Whether or not to use bold text.<br/>
	 * @param italic Whether or not to use italic text.<br/>
	 * @param underline Whether or not to underline the text.<br/>
	 */
	private void init(boolean bold, boolean italic, boolean underline) {
		StringBuffer buffer = new StringBuffer(1024);
		if(bold) buffer.append(Constants.CSS_FONT_BOLD);
		if(italic) buffer.append(Constants.CSS_FONT_ITALIC);
		if(underline) buffer.append(Constants.CSS_FONT_UNDERLINE);
		this.setStyle(buffer.toString());
	} // END init

	/**
	 * getUserAgentStylesheet.<br/>
	 * @return String The path to the style-sheet to use for styling this component.<br/>
	 */
	@Override
	protected String getUserAgentStylesheet() {
		return LibraryList.class.getResource(Constants.CURRENT_SKIN).toExternalForm();
	} // END getUserAgentStylesheet
} // END class class TrackLabel
